package com.test;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class DateUtils {

	public static void main(String[] args) throws ParseException {
//    	String time = "2020-10-11 10:10:10";
//    	SimpleDateFormat sl = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
//    	Date date = sl.parse(time);
//    	
		String time = "2019/09/09";
		//String time = "2019/9/9";
		SimpleDateFormat sl = new SimpleDateFormat("yyyyMMdd");
		Date date = sl.parse(time);
		Calendar c1 = Calendar.getInstance();
		c1.setTime(date);

		String strtime = sl.format(date);
		System.err.println(strtime);
		System.out.println(c1.get(Calendar.YEAR));
		System.out.println(c1.get(Calendar.MONTH) + 1);
		System.out.println(c1.get(Calendar.DAY_OF_MONTH));
	}
}
